package com.zyh.system.supermark1.domain;
/*
这是一个购物车描述类
 */
import java.math.BigDecimal;

public class BuyCar {
    private String id;
    private String name;
    private BigDecimal price;
    private Integer buyNum;

    public BuyCar() {
    }

    public BuyCar(String id, String name, BigDecimal price, Integer buyNum) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.buyNum = buyNum;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getBuyNum() {
        return buyNum;
    }

    public void setBuyNum(Integer buyNum) {
        this.buyNum = buyNum;
    }

    @Override
    public String toString() {
        return "BuyCar{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", buyNum=" + buyNum +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        BuyCar buyCar = (BuyCar) o;

        if (id != null ? !id.equals(buyCar.id) : buyCar.id != null) return false;
        if (name != null ? !name.equals(buyCar.name) : buyCar.name != null) return false;
        if (price != null ? !price.equals(buyCar.price) : buyCar.price != null) return false;
        return buyNum != null ? buyNum.equals(buyCar.buyNum) : buyCar.buyNum == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (price != null ? price.hashCode() : 0);
        result = 31 * result + (buyNum != null ? buyNum.hashCode() : 0);
        return result;
    }
}
